//
//  SettingInfo.m
//  ShoutBoss
//
//  Created by Yin supmarboro on 09-6-27.
//  Copyright 2009 JW. All rights reserved.
//

#import "SettingInfo.h"
 

@implementation SettingInfo 

static SettingInfo *sharedGizmoManager = nil;

-(id) init
{
	self = [super init];
	if(self != nil){
		Sound = 100;
		BGMusic = YES;
		ActionMusic = YES;
	}
	
	return self;
}

- (void) SetSound:(int)sound
{
	Sound = sound;
}
- (void) SetBGMusic:(bool)value
{
	BGMusic = value;
}

- (void) SetActionMusic:(bool)value
{
	ActionMusic = value;
}

-(int) GetSound
{
	return Sound;
}

-(int) GetBGMusic
{
	return BGMusic;
}

-(int) GetActionMusic
{
	return ActionMusic;
}

+ (SettingInfo*)sharedManager
{
    @synchronized(self) {
        if (sharedGizmoManager == nil) {
            [[self alloc] init]; // assignment not done here
        }
    }
    return sharedGizmoManager;
}

+ (id)allocWithZone:(NSZone *)zone
{
    @synchronized(self) {
        if (sharedGizmoManager == nil) {
            sharedGizmoManager = [super allocWithZone:zone];
            return sharedGizmoManager;  // assignment and return on first allocation
        }
    }
    return nil; //on subsequent allocation attempts return nil
}

- (id)copyWithZone:(NSZone *)zone
{
    return self;
}

- (id)retain
{
    return self;
}

- (unsigned)retainCount
{
    return UINT_MAX;  //denotes an object that cannot be released
}

- (void)release
{
    //do nothing
}

- (id)autorelease
{
    return self;
}
@end
